package com.eastidea.live.entity;

// Generated Feb 8, 2013 11:13:15 AM by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.SEQUENCE;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * FrmUiForm generated by hbm2java
 */
@Entity
@Table(name = "frm_ui_form", schema = "public")
public class FrmUiForm implements java.io.Serializable {

	private Long id;
	private String mongoId;
	private AppApplication appApplication;
	private String headline;
	private AppUser appUser;
	private Date updateTime;
	private Integer status;
	private Boolean oncePerIp;
	private Integer apiVer;
	private String json;
	private String qrCode;
	
	private List<FrmUiField> FrmUiFields = new LinkedList<FrmUiField>();

	public FrmUiForm() {
	}

	public FrmUiForm(AppUser appUser) {
		this.appUser = appUser;
	}

	public FrmUiForm(AppApplication appApplication, String headline,
			AppUser appUser, Date updateTime, Integer status, Boolean oncePerIp,
			List<FrmUiField> FrmUiFields) {
		this.appApplication = appApplication;
		this.headline = headline;
		this.appUser = appUser;
		this.updateTime = updateTime;
		this.status = status;
		this.oncePerIp = oncePerIp;
		this.FrmUiFields = FrmUiFields;
	}

	@SequenceGenerator(name = "generator", sequenceName = "frm_ui_form_seq")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "app_id")
	public AppApplication getAppApplication() {
		return this.appApplication;
	}

	public void setAppApplication(AppApplication appApplication) {
		this.appApplication = appApplication;
	}

	@Column(name = "headline", length = 500)
	public String getHeadline() {
		return this.headline;
	}

	public void setHeadline(String headline) {
		this.headline = headline;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public AppUser getAppUser() {
		return this.appUser;
	}
	public void setAppUser(AppUser appUser) {
		this.appUser = appUser;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time", length = 29)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "once_per_ip")
	public Boolean getOncePerIp() {
		return this.oncePerIp;
	}

	public void setOncePerIp(Boolean oncePerIp) {
		this.oncePerIp = oncePerIp;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "frmUiForm")
	@OrderBy("indexx")
	public List<FrmUiField> getFrmUiFields() {
		return this.FrmUiFields;
	}

	public void setFrmUiFields(List<FrmUiField> FrmUiFields) {
		this.FrmUiFields = FrmUiFields;
	}
	
	@Column(name = "json", length = 10000)
	public String getJson() {
		return json;
	}
	public void setJson(String json) {
		this.json = json;
	}

	@Column(name = "api_ver")
	public Integer getApiVer() {
		return apiVer;
	}
	public void setApiVer(Integer apiVer) {
		this.apiVer = apiVer;
	}

	@Column(name = "qrcode")
	public String getQrCode() {
		return qrCode;
	}
	public void setQrCode(String qrCode) {
		this.qrCode = qrCode;
	}

	@Column(name = "mongo_id")
	public String getMongoId() {
		return mongoId;
	}
	public void setMongoId(String mongoId) {
		this.mongoId = mongoId;
	}

}
